import React from "react";
import ReactDOM from "react-dom/client";
import { router } from "./router";
import { RouterProvider } from "react-router-dom"
import "../assets/css/reset.css"
import { ConfigProvider, theme } from "antd";

const { getDesignToken } = theme;

const globalToken = getDesignToken();
// 获取 html dom元素的style属性
// const htmlStyle = document.documentElement.style
// 伪类不是dom只读 无法写入
// const htmlStyle = window.getComputedStyle(document.documentElement, ":root")
// htmlStyle.setProperty("--colorPrimary", globalToken.colorPrimary)
document.styleSheets[0].insertRule(`:root {
    --colorPrimary:${globalToken.colorPrimary};
    --colorBorder:${globalToken.colorBorder};
    --colorSubText:#767676;
}`)

const root = ReactDOM.createRoot(document.getElementById("root"))
root.render(
    <ConfigProvider
        theme={{ cssVar: true }}>
        <RouterProvider router={router}></RouterProvider>
    </ConfigProvider>
)